Skip to content

fix: keep system tools with persona tool lists#8908

Merged
Soulter merged 1 commit into
masterfrom
codex/keep-system-tools-with-persona
Jun 19, 2026
Merged

fix: keep system tools with persona tool lists#8908
Soulter merged 1 commit into
masterfrom
codex/keep-system-tools-with-persona

Conversation

@Soulter

@Soulter Soulter commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove the final persona tool allow-list filter from the main agent build flow.
  • Keep system-injected tools such as web search and local computer-use tools available even when a persona defines an explicit empty tool list.
  • Update regression coverage to assert that late system tools remain available.

Tests

  • uv run pytest tests/unit/test_astr_main_agent.py -q -k "persona_empty_tools_keeps or subagent_dedupe_uses_default_persona_tools or apply_web_search_tools or proactive_cron_job_tools"
  • uv run pytest tests/unit/test_astr_agent_tool_exec.py tests/unit/test_astr_main_agent.py -q -k "persona_empty_tools_keeps or subagent_dedupe_uses_default_persona_tools or build_handoff_toolset_keeps_permission_guards_for_default_tools"
  • uv run ruff format .
  • uv run ruff check .

Summary by Sourcery

Preserve system-injected tools when personas specify explicit tool lists, and update tests accordingly.

Bug Fixes:

  • Ensure system web search tools remain available even when a persona defines an empty tool list.
  • Ensure local computer-use runtime tools remain available for personas with empty tool lists.

Enhancements:

  • Simplify persona tool handling by removing the final allow-list filter from the main agent build flow.

Tests:

  • Extend main agent tests to cover retention of late web search tools for personas with empty tool lists.
  • Add regression test to verify local runtime builtin tools remain available with empty persona tool lists.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. area:core The bug / feature is about astrbot's core, backend feature:persona The bug / feature is about astrbot AI persona system (system prompt) labels Jun 19, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the tool filtering logic based on persona allowed tools from the main agent building process. Specifically, the functions _ensure_persona_and_skills and _decorate_llm_request no longer return allowed tools, and the filtering of req.func_tool.tools in build_main_agent has been removed. This ensures that late-bound builtin tools (such as web search) and local runtime builtin tools (such as shell and Python execution) are preserved even when a persona specifies empty tools. Unit tests have been updated and added to verify this new behavior. As there are no review comments, no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Soulter Soulter merged commit da7f53d into master Jun 19, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend feature:persona The bug / feature is about astrbot AI persona system (system prompt) size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant